<template>
  <a-drawer v-model:visible="visible" title="会议详情" :width="width >= 580 ? 680 : '100%'" :footer="false">
    <a-descriptions :column="2" size="large" class="general-description">
      <a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
      <a-descriptions-item label="会议ID">{{ dataDetail?.conferenceId }}</a-descriptions-item>
      <a-descriptions-item label="会议室id">{{ dataDetail?.meetingRoomId }}</a-descriptions-item>
      <a-descriptions-item label="">{{ dataDetail?.meetingRoomName }}</a-descriptions-item>
      <a-descriptions-item label="会议主题">{{ dataDetail?.subject }}</a-descriptions-item>
      <a-descriptions-item label="参与人数">{{ dataDetail?.size }}</a-descriptions-item>
      <a-descriptions-item label="开始时间">{{ dataDetail?.startTime }}</a-descriptions-item>
      <a-descriptions-item label="结束时间">{{ dataDetail?.endTime }}</a-descriptions-item>
      <a-descriptions-item label="会议室状态">{{ dataDetail?.conferenceState === 0 ? '预约' : dataDetail?.conferenceState === 1 ? '已开始' : dataDetail?.conferenceState === 2 ? '取消' : dataDetail?.conferenceState === 3 ? '结束' : '' }}</a-descriptions-item>
      <a-descriptions-item label="来宾会议密码">{{ dataDetail?.passwordGeneral }}</a-descriptions-item>
      <a-descriptions-item label="主持人会议密码">{{ dataDetail?.passwordChair }}</a-descriptions-item>
      <a-descriptions-item label="创建人">{{ dataDetail?.createUser }}</a-descriptions-item>
      <a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
      <a-descriptions-item label="会议室类型">{{ dataDetail?.meetType == 0 ? '线下' : dataDetail?.meetType == 1 ? '向上' : '' }}</a-descriptions-item>
      <!-- <a-descriptions-item label="会议数据">{{ dataDetail?.conferenceInfo }}</a-descriptions-item> -->
      <a-descriptions-item label="创建时间">{{ dataDetail?.createTime }}</a-descriptions-item>
      <a-descriptions-item label="修改时间">{{ dataDetail?.updateTime }}</a-descriptions-item>
    </a-descriptions>
  </a-drawer>
</template>

<script lang="ts" setup>
import { useWindowSize } from '@vueuse/core'
import { type MeetDetailResp, getMeet } from '@/apis/meet/meet'

const { width } = useWindowSize()

const visible = ref(false)
const dataId = ref('')
const dataDetail = ref<MeetDetailResp>()
// 查询详情
const getDataDetail = async () => {
  const res = await getMeet(dataId.value)
  dataDetail.value = res.data
}

// 打开详情
const onDetail = async (id: string) => {
  dataId.value = id
  await getDataDetail()
  visible.value = true
}

defineExpose({ onDetail })
</script>

<style lang="scss" scoped></style>
